<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>新建网页</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="description" content="" />
        <meta name="keywords" content="" />

		<script src="../jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
        <link href="11.css" type="text/css" rel="stylesheet" />
        <script type="text/javascript">
        function f1(){
            //获得选中情况
            //$(:selected)
			//只能单选
            console.log($('option:selected').val()); //单选情况
            
			// 即能单选又能多选，推荐这个
            console.log($('select').val());//["1", "3"] 多选情况
        }
        function f2(){
            //设置选中情况
            //$(下拉列表).val([value值，value值])
            //$('select').val([1]);
            $('select').val([2,3]);
        }
        </script>
        <style type="text/css">
        div{color:red; border:4px solid blue;}
        </style>
    </head>
    <body>
        <h1>下拉列表操作</h1>

        学历：
        <select multiple>
            <option value="0">请选择</option>
            <option value="1">小学</option>
            <option value="2">中学</option>
            <option value="3">大学</option>
        </select>

        <br /><br />
        <input type="button" value="获取" onclick="f1()" />
        <input type="button" value="设置" onclick="f2()" />
    </body>
</html>